package com.cyclinggle.cloud.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cyclinggle.cloud.model.User;

@RestController
@RequestMapping(value = "/users")
public class UserController {
	
	@GetMapping("/")
	public String getUser(User user, HttpServletRequest request) {
		return "hello " + user.getName();
	}
	
	@PostMapping(value = "/update")
	public String update(@RequestBody User user) {
		return "hello update 姓名 " + user.getName();
	}
	
}
